import request from '@/utils/request'

// 随机抽取试题
export function randStudyQuestion(query) {
  return request({
    url: '/study/studyQuestion/rand',
    method: 'get',
    params: query
  })
}

// 查询试题数量
export function countStudyQuestion(query) {
  return request({
    url: '/study/studyQuestion/count',
    method: 'get',
    params: query
  })
}

// 查询试题列表
export function listStudyQuestion(query) {
  return request({
    url: '/study/studyQuestion/list',
    method: 'get',
    params: query
  })
}

// 查询试题详细
export function getStudyQuestion(id) {
  return request({
    url: '/study/studyQuestion/' + id,
    method: 'get'
  })
}

// 新增试题
export function addStudyQuestion(data) {
  return request({
    url: '/study/studyQuestion',
    method: 'post',
    data: data
  })
}

// 修改试题
export function updateStudyQuestion(data) {
  return request({
    url: '/study/studyQuestion',
    method: 'put',
    data: data
  })
}

// 删除试题
export function delStudyQuestion(id) {
  return request({
    url: '/study/studyQuestion/' + id,
    method: 'delete'
  })
}

// 导出试题
export function exportStudyQuestion(query) {
  return request({
    url: '/study/studyQuestion/export',
    method: 'get',
    params: query
  })
}
